<template>
  <!-- html 结构 -->
  <div class="preson">
    <h2>当前求和为：{{ sum }}， sum放大10被后：{{ bigSum }}</h2>
    <button @click="add">点我sum+1</button>
    <hr />
    <img v-for="(item, index) in dogList" :src="item" :key="index" alt="" />
    <br />
    <button @click="dogAgain">再来一只狗狗</button>
  </div>
</template>

<!-- 在vue3中监事一个reactive定义的响应式常量应该是这么写的 -->
<script lang="ts" name="Person" setup>
import useDog from "@/hooks/useDog";
import useSum from "@/hooks/useSum";

const { sum, add, bigSum } = useSum();
const { dogList, dogAgain } = useDog();
</script>

<!-- scoped局部样式: -->
<style scoped>
.preson {
  background-color: rgb(120, 145, 46);
  box-shadow: 0 0 10px;
  border-radius: 10px;
}
/* 样式 */
button {
  background-color: aqua;
  margin: 5px;
}
img {
  height: 100px;
  margin: 0 5px;
}
</style>
